<? if( $_SESSION[ "JC_account_authority" ] == "administrator" ||$_SESSION[ "JC_account_authority" ] == "account" ) { ?>

	<b>account</b><br /><hr />

	<? $JC_account = JC_query( "SELECT * FROM `account` WHERE `key` = '" . $_SESSION[ "JC_account_key" ] . "'" ); ?>

	<table>

		<tr>

			<? foreach( $_SESSION[ "JC_scheme" ][ "account" ] as $key => $value ) { ?>

				<? if( $key == "comment"	) continue; ?>
				<? if( $key == "identifier"	) continue; ?>
				<? if( $key == "authority"	) continue; ?>
				<? if( $key == "name"		) continue; ?>
				<? if( $key == "note"		) continue; ?>
				<? if( $key == "log"		) continue; ?>
				<? if( $key == "insert"		) continue; ?>
				<? if( $key == "update"		) continue; ?>
				<? if( $key == "delete"		) continue; ?>

				<th><?= JC_TH( $key ) ?></th>

			<? } ?>

			<th>Update</th>

		</tr>



		<? if( $JC_account ) while( $record = $JC_account -> fetch_array( ) ) { ?>

			<tr>

				<form id="JC_update_form_<?= $record[ "key" ] ?>" target="JC_asynchronous" method="post">

					<input type="hidden" name="JC_query"				value="update"								/>
					<input type="hidden" name="JC_table"				value="account"								/>
					<input type="hidden" name="JC_update_key"		value="<?= $record[ "key"			] ?>"	/>

					<input type="hidden" name="JC_update_identifier"	value="<?= $record[ "identifier"	] ?>"	/>
					<input type="hidden" name="JC_update_name"		value="<?= $record[ "name"			] ?>"	/>
					<input type="hidden" name="JC_update_authority"	value="<?= $record[ "authority"		] ?>"	/>



					<? foreach( $_SESSION[ "JC_scheme" ][ "account" ] as $key => $value ) { ?>

						<? if( $key == "comment"	) continue; ?>
						<? if( $key == "identifier"	) continue; ?>
						<? if( $key == "authority"	) continue; ?>
						<? if( $key == "name"		) continue; ?>
						<? if( $key == "note"		) continue; ?>
						<? if( $key == "log"		) continue; ?>
						<? if( $key == "insert"		) continue; ?>
						<? if( $key == "update"		) continue; ?>
						<? if( $key == "delete"		) continue; ?>



						<? if( $key == "key" ) { ?>

							<td class="right form"><?= number_format( $record[ $key ] ) ?></td>

						<? } ?>



						<? if( strpos( $value[ "type" ], "char" ) !== false || strpos( $value[ "type" ], "date" ) !== false ) { // Character & Date ?>

							<td>

								<input
									id		= "JC_select_<?= $key ?>_<?= $record[ "key" ] ?>"
									name	= "JC_update_<?= $key ?>"
									value	= "<?= $record[ $key ] ?>"
									title	= "<?= $record[ $key ] ? $record[ $key ] : $value[ "type" ] ?>"
									size	= "<?= $value[ "size" ] ? $value[ "size" ] : 24 ?>"
									onblur	= "if( this.value ) { this.title = this.value; } else { this.title = '<?= $value[ "type" ] ?>'; }"
								/>

							</td>

						<? } ?>



						<? if( $value[ "type" ] == "text" ) { // Text ?>

							<td>

								<textarea
									name	= "JC_update_<?= $key ?>"
									title	= "<?= $record[ $key ] ? $record[ $key ] : $value[ "type" ] ?>"
									cols	= "<?= $value[ "size" ] ? $value[ "size" ] : ( $value[ "FKF" ] ? "6" : "24" ) ?>"
									rows	= "4"

									<? if( JC_authority( $value[ "AIUD" ] ) && $key != "log" ) { ?>

										id		= "JC_select_<?= $key ?>_<?= $record[ "key" ] ?>"
										onfocus	= "document.getElementById( 'JC_update_<?= $record[ "key" ] ?>' ).innerHTML = 'Update';"
										onblur	= "if( this.value ) { this.title = this.value; } else { this.title = '<?= $value[ "type" ] ?>'; }"

									<? } else { ?>

										readonly

									<? } ?>

								><?= $record[ $key ] ?></textarea>

							</td>

						<? } ?>



					<? } ?>



					<td>
						<a
							href	= "#this"
							id		= "JC_update_<?= $record[ "key" ] ?>"
							onclick	= "document.getElementById( 'JC_update_form_<?= $record[ "key" ] ?>' ).submit( );"
							class	= "form"
						/>Update</a>
					</td>

				</form>

			<tr>

		<? } ?>

	</table><hr />

<? } ?>
